﻿#ifndef ITOOLBAR_H
#define ITOOLBAR_H

#include "ribbontoolbarglobal.h"
#include <QWidget>
#include <QString>
#pragma execution_character_set("utf-8")
// 接口类仅定义状态操作，信号由具体实现类提供
class RIBBONTOOLBAR_EXPORT IToolbar
{
public:
	virtual ~IToolbar() = default;

	virtual QWidget* widget() = 0;

	// 工具栏状态更新
	virtual void setBoldState(bool bold) = 0;
	virtual void setItalicState(bool italic) = 0;
	virtual void setUnderlineState(bool underline) = 0;
	virtual void setFontFamily(const QString& family) = 0;
	virtual void setFontSize(int size) = 0;
	virtual void setStrikethroughState(bool strikethrough) = 0;
	virtual bool strikethroughState() const = 0;
	// 设置当前字体颜色（供外部同步状态）
	virtual void setFontColor(const QColor& color) = 0;
	void setAlignmentChecked(Qt::Alignment align, bool checked); // 设置按钮选中状态

	// 获取工具栏当前状态
	virtual bool boldState() const = 0;
	virtual bool italicState() const = 0;
	virtual bool underlineState() const = 0;
	virtual QString fontFamily() const = 0;
	virtual int fontSize() const = 0;
	// 获取当前字体颜色
	virtual QColor currentFontColor() const = 0;
	Qt::Alignment currentAlignment() const;

};

#endif // ITOOLBAR_H